package org.cshoo.sys.business
{
	import hessian.client.HessianService;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	
	import org.cshoo.common.business.ServiceLocator;
	import org.cshoo.sys.model.vo.Organization;
	
	public class OrganizationDelegate
	{
	
		public var serviceLocator:ServiceLocator = ServiceLocator.getInstance();
		
		public var _service:HessianService;
		
		private var _responder:IResponder;
		
		public function OrganizationDelegate(responder:IResponder)
		{
			_service = serviceLocator.organizationService;
			this._responder = responder;
		}
		
		public function findOrganizationList(organization:Organization):void
		{
			var asyncToken:AsyncToken　=　_service.getOperation("findOrganizationList").send(organization);
			asyncToken.addResponder(_responder);
		}
		
		public function addOrganization(organization:Organization):void
		{
			var asyncToken:AsyncToken　=　_service.getOperation("addOrganization").send(organization);
			asyncToken.addResponder(_responder);
		}
		
		public function deleteOrganization(organization:Organization):void
		{
			var asyncToken:AsyncToken　=　_service.getOperation("deleteOrganization").send(organization);
			asyncToken.addResponder(_responder);
		}
		
		public function updateOrganization(organization:Organization):void
		{
			var asyncToken:AsyncToken　=　_service.getOperation("updateOrganization").send(organization);
			asyncToken.addResponder(_responder);
		}
		
		public  function findRootOrganizationList():void
		{
			var asyncToken:AsyncToken　=　_service.getOperation("findRootOrganizationList").send();
			asyncToken.addResponder(_responder);
		}
	}
}